package com.dissertation.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by jsh3 on 17-12-4.
 * 语义标签
 */

@Document
public class Tag {

    enum Status {
        COMMON, // 共有
        SELF // 自定义
    }

    @Id
    private String id;

    @Indexed( unique = true )
    @NotEmpty( message = "标签名不能为空" )
    private String uniqueName;

    private int count; // 引用次数

    private Status status = Status.SELF; // 共有

    public String getId() {
        return id;
    }

    public void setId( String id ) {
        this.id = id;
    }

    public String getUniqueName() {
        return uniqueName;
    }

    public void setUniqueName( String uniqueName ) {
        this.uniqueName = uniqueName;
    }

    public int getCount() {
        return count;
    }

    public void setCount( int count ) {
        this.count = count;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus( Status status ) {
        this.status = status;
    }
}
